package top.ishowcode.bootweb01.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.ishowcode.bootweb01.services.ProductServices;
import top.ishowcode.bootweb01.services.UserServices;

@RestController
public class UserController {
    @Autowired
    UserServices userServices;
    @Autowired
    ProductServices productServices;
    @GetMapping("/getuseraddr/{id}")
    public String GetUserAddr(@RequestParam("id") int id){
        return userServices.getUserAddrById(id);
    }
    @GetMapping("/getproName/{id}")
    public String GetProName(@RequestParam("id") int id){return productServices.getNameById(id);}
}
